//
//  RestaurantCell.m
//  南京大牌档
//
//  Created by student on 14-1-14.
//  Copyright (c) 2014年 无锡第三团队. All rights reserved.
//

#import "RestaurantCell.h"

@implementation RestaurantCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initSubView];
    }
    return self;
}

-(void)initSubView
{
    _restaurantImage=[[UIImageView alloc]initWithFrame:CGRectZero];
    _restaurantImage.backgroundColor=[UIColor clearColor];
    [self.contentView addSubview:_restaurantImage];
    
    _titleLabel=[[UILabel alloc]initWithFrame:CGRectZero];
    _titleLabel.backgroundColor=[UIColor clearColor];
    _titleLabel.font=[UIFont systemFontOfSize:17];
    [self.contentView addSubview:_titleLabel];
    
    _distanceLabel=[[UILabel alloc]initWithFrame:CGRectZero];
    _distanceLabel.backgroundColor=[UIColor clearColor];
    _distanceLabel.font=[UIFont systemFontOfSize:10];
    _distanceLabel.textColor=[UIColor redColor];
    [self.contentView addSubview:_distanceLabel];
    
    _addressLabel=[[UILabel alloc]initWithFrame:CGRectZero];
    _addressLabel.backgroundColor=[UIColor clearColor];
    _addressLabel.font=[UIFont systemFontOfSize:10];
    _addressLabel.numberOfLines=2;
    _addressLabel.textAlignment=0;
    [self.contentView addSubview:_addressLabel];
    
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    _restaurantImage.frame=CGRectMake(5, 5, 120, 90);
    _titleLabel.frame=CGRectMake(130, 5, 160, 30);
    _distanceLabel.frame=CGRectMake(130, 40, 100, 30);
    _addressLabel.frame=CGRectMake(130, 65, 180, 30);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
